package model.parser;

import util.resources.ResourceManager;

/**
 * Represents an exceptional situation specific to this project.
 * 
 * @author Robert C. Duvall
 */
@SuppressWarnings("serial")
public class ParserException extends RuntimeException {
    private static ResourceManager manager = ResourceManager
            .getManager("model");

    public static class BadArgumentsException extends ParserException {
        public BadArgumentsException() {
            super(manager.getString("BAD_ARGUMENTS"));
        }
    }

    public static class BadSyntaxException extends ParserException {
        public BadSyntaxException() {
            super(manager.getString("BAD_SYNTAX"));
        }
    }

    public static class BadTokenException extends ParserException {
        public BadTokenException() {
            super(manager.getString("BAD_TOKEN"));
        }
    }

    public static ParserException BAD_TOKEN = new BadTokenException();

    public static ParserException BAD_ARGUMENTS = new BadArgumentsException();

    public static ParserException BAD_SYNTAX = new BadSyntaxException();

    public static ParserException UNMATCHED_PAREN = new ParserException(
            manager.getString("UNMATCHED_PAREN"));

    public static ParserException IMPLEMENTATION_ERROR = new ParserException(
            manager.getString("IMPLEMENTATION_ERROR"));

    /**
     * Create exception with given message
     * 
     * @param message
     *            explanation of problem
     */
    public ParserException(String message) {
        super(message);
    }
}